import request from '@/utils/request'

// 查询仓库列表
export function listManage(query) {
  return request({
    url: '/yyj/wm/warehouse/manage/list',
    method: 'get',
    params: query
  })
}

// 查询仓库详细
export function getManage(wCode) {
  return request({
    url: '/yyj/wm/warehouse/manage/' + wCode,
    method: 'get'
  })
}

// 新增仓库
export function addManage(data) {
  return request({
    url: '/yyj/wm/warehouse/manage',
    method: 'post',
    data: data
  })
}

// 修改仓库
export function updateManage(data) {
  return request({
    url: '/yyj/wm/warehouse/manage',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function delManage(wCode, saCount) {
  if (!saCount.length > 0) {
    saCount.push(0);
  }
  return request({
    url: '/yyj/wm/warehouse/manage/' + wCode + '/' + saCount,
    method: 'delete'
  })
}
